//
//  CCHomeAdapter.m
//  ccZone
//
//  Created by 陈小娟 on 2017/12/15.
//  Copyright © 2017年 CC. All rights reserved.
//

#import "CCHomeAdapter.h"

@implementation CCHomeAdapter

-(instancetype)init {
    self =[super init];
    if (self) {
        [self initial];
    }
    return self;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return self.dataArray.count;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return ((NSArray *)self.dataArray[section]).count;
}

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    //父类默认Cell
    BaseCell *cell = [tableView dequeueReusableCellWithIdentifier:BaseCellID];
    [cell setBModel:self.dataArray[indexPath.section][indexPath.row]];
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 80.0f;
}

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 10.0f;
}

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    return [UIView new];
}

-(void)initial {
    NSMutableArray *tmps = [NSMutableArray array];
    //
    NSArray *tmp10 = @[
                       ];
    [tmps addObject:tmp10];
    
    for (NSArray *obj in  tmps) {
        id json = [obj yy_modelToJSONObject];
        NSArray *tmp = [NSArray yy_modelArrayWithClass:[BaseModel class] json:json];
        [self.dataArray addObject:tmp];
    }
}


@end
